package com.medaxis.hpams.sso.controller;


import com.medaxis.hpams.sso.annotation.DataScope;
import com.medaxis.hpams.sso.constant.Constants;
import com.medaxis.hpams.sso.domain.Menu;
import com.medaxis.hpams.sso.service.MenuService;
import com.medaxis.hpams.dto.global.BaseResponse;
import com.medaxis.hpams.dto.global.SuccessResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@RestController()
@RequestMapping(Constants.VERSION_NUMBER)
@Api(tags = Constants.VERSION_NUMBER+ "菜单管理接口")
public class MenuController {
    @Autowired
    MenuService menuService;

    @GetMapping("list")
    @ApiOperation(value = "查询菜单列表信息", httpMethod = "GET")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "systemId", value = "系统归属", required = true, dataType = "String", paramType = "query"),
    })
    public BaseResponse<List<Menu>> selectMenuList(@Validated Menu menu){

        List<Menu> menuServiceList = menuService.selectMenuList(menu);
        return SuccessResponse.success(menuServiceList);
    }

}
